/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package co.edu.senaclem.logica;

import co.edu.senaclem.modelo.Dependencia;
import co.edu.senaclem.persistencia.IDependenciaDAO;
import java.util.List;
import javax.ejb.EJB;
import javax.ejb.Stateless;

/**
 *
 * @author anfeles
 */
@Stateless
public class DependenciaLogica implements DependenciaLogicaLocal {
    
    @EJB
    private IDependenciaDAO dependenciaDAO;
    
    
    @Override
    public Dependencia consultarPorId(Integer codigo) throws Exception {
        if(codigo==null || codigo==0){
            throw new Exception("La Dependencia es Obligatoria!");
        }
        return dependenciaDAO.consultarPorId(codigo);
    }

    @Override
    public List<Dependencia> consultar() throws Exception {
        return dependenciaDAO.consultar();
    }
    
    
}
